﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using Com.Library.DB.PageAuth;
using Com.Library.DB.Manager;
using Com.Web.coffinegurunaru.AppLogic.Page;

namespace Com.Web.coffinegurunaru.manager.page
{
    public partial class ManagerMasterPage : Com.Web.coffinegurunaru.AppLogic.Page.ManagerMasterPage
    {
		public int IsManager { get; set; }
		public List<PageAuthMainEntity> PageAuthMainList = null;
        protected void Page_Load(object sender, EventArgs e)
        {
			this.IsManager = ManagerModel.GetInfo(this.WebCookies.ManagerSN, string.Empty).IsManager;
			PageAuthMainList = PageAuthModel.PageAuthMainList(this.WebCookies.ManagerSN);
        }

		public bool IsMenuCheck(int MainPageType)
		{
			if (IsManager == 1)
				return true;

			foreach (PageAuthMainEntity item in PageAuthMainList)
			{
				if (item.MainPageType == MainPageType)
					return item.CodeAuthType == 1 ? true : false;
			}

			return false;
		}
    }
}
